package enumdemo;

//带属性的枚举
enum Size2{
	S(150,160),M(161,165),L(166,170),XL(171,180),XXL(181,200);
	//属性不提供set方法
	private int min;
	private int max;
	//只能通过构造赋值
	Size2(int min,int max){
		this.min = min;
		this.max = max;
	}
	//要提供get方法
	public int getMin() {
		return min;
	}
	public int getMax() {
		return max;
	}
}

public class EnumTest2 {
	public static void main(String[] args) {
		Size2 mySize = Size2.M;
		
		switch (mySize) {
			case S : System.out.println("小号"); break;
			case M : System.out.println("中号"); break;
			case L : System.out.println("大号"); break;
			case XL : System.out.println("超大号"); break;
			case XXL : System.out.println("超超大号"); break;
		}
		System.out.println(mySize.getMin());
		System.out.println(mySize.getMax());
	}
}
